# Maintainer: Dale Blount <dale@archlinux.org>
# Contributor: Dale Blount <dale@archlinux.org>
# Contributor: François Charette <francois.archlinux.org>

pkgname=perl-mail-spf
pkgver=2.9.0
pkgrel=8
pkgdesc="Perl module that provides SPF support"
arch=('any')
license=('custom')
url="https://search.cpan.org/dist/Mail-SPF/"
depends=('perl-error' 'perl-netaddr-ip' 'perl-uri' 'perl-net-dns' 'perl')
makedepends=('perl-module-build' 'perl-net-dns-resolver-programmable')
conflicts=('perl-mail-spf-query')
options=('!emptydirs')
source=("https://search.cpan.org/CPAN/authors/id/J/JM/JMEHNLE/mail-spf/Mail-SPF-v${pkgver}.tar.gz")
md5sums=('664e20d79c87fa505080f362e827dace')

prepare() {
  cd Mail-SPF-v${pkgver}
  sed -i 's|/usr/sbin|/usr/bin|' Build.PL
}

build() {
  cd Mail-SPF-v${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd Mail-SPF-v${pkgver}
  make test
}

package() {
  cd Mail-SPF-v${pkgver}
  make DESTDIR="${pkgdir}" install
  install -D -m644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
